package com.aidex.biz.service.impl;

import com.aidex.biz.domain.CockpitInfo;
import com.aidex.biz.mapper.CockpitInfoMapper;
import com.aidex.biz.service.CockpitInfoService;
import com.aidex.common.annotation.DataScope;
import com.aidex.common.core.service.BaseServiceImpl;
import com.aidex.common.utils.NumberUtils;
import com.github.pagehelper.PageInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 驾驶舱信息Service业务层处理
 * @author sean
 * @email 2074844820@qq.com
 * @date 2024-11-25
 */
@Service
@Transactional(readOnly = true)
public class CockpitInfoServiceImpl extends BaseServiceImpl<CockpitInfoMapper, CockpitInfo> implements CockpitInfoService
{
    private static final Logger log = LoggerFactory.getLogger(CockpitInfoServiceImpl.class);

    /**
     * 获取单条数据
     * @param cockpitInfo 驾驶舱信息
     * @return 驾驶舱信息
     */
    @Override
    public CockpitInfo get(CockpitInfo cockpitInfo)
    {
        CockpitInfo dto = super.get(cockpitInfo);
        return dto;
    }

    /**
     * 获取单条数据
     * @param id 驾驶舱信息id
     * @return 驾驶舱信息
     */
    @Override
    public CockpitInfo get(String id)
    {
        CockpitInfo dto = super.get(id);
        return dto;
    }


    /**
     * 查询驾驶舱信息列表
     * @param cockpitInfo 驾驶舱信息
     * @return 驾驶舱信息
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public List<CockpitInfo> findList(CockpitInfo cockpitInfo)
    {
        return super.findList(cockpitInfo);
    }

    /**
     * 分页查询驾驶舱信息列表
     * @param cockpitInfo 驾驶舱信息
     * @return 驾驶舱信息
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public PageInfo<CockpitInfo> findPage(CockpitInfo cockpitInfo)
    {
        return super.findPage(cockpitInfo);
    }

    /**
     * 保存驾驶舱信息
     * @param cockpitInfo
     * @return 结果
     */
    @Override
    public boolean save(CockpitInfo cockpitInfo)
    {
        return super.save(cockpitInfo);
    }


    /**
     * 删除驾驶舱信息信息
     * @param cockpitInfo
     * @return 结果
     */
    @Override
    public boolean remove(CockpitInfo cockpitInfo)
    {
        return super.remove(cockpitInfo);
    }

    /**
     * 批量删除驾驶舱信息
     * @param ids 需要删除的驾驶舱信息ID
     * @return 结果
     */
    @Transactional(readOnly = false)
    @Override
    public int deleteCockpitInfoByIds(String[] ids)
    {
        return mapper.deleteCockpitInfoByIds(ids);
    }

    /**
     * 获取最大编号
     * @param cockpitInfo 驾驶舱信息
     * @return 结果
     */
    @Override
    public int findMaxSort(CockpitInfo cockpitInfo)
    {
        return NumberUtils.nextOrder(mapper.findMaxSort(cockpitInfo));
    }
}
